<div class="bg-light lter b-b wrapper-md">
    <h1 class="m-n font-thin h3"><span class="font-bold" translate="aside.nav.process.servicefinish">Evaluation</span>
    </h1>
</div>
<div ng-class="isSmart?'':'wrapper-md'" class="remove-wrapper" >
    <div ng-controller="FinishDataTableController">
        <div class="panel panel-default">
            <div>
                <div class="row wrapper-sm">
                    <div class="col-xs-12">
                        <div class="input-group">
                            <input ng-model="$parent.like" class="form-control"
                                   placeholder="{{ (selectLang == 'English') ? 'enter keywords' : '\u8bf7\u8f93\u5165\u5173\u952e\u5b57' }}" type="text"
                                   autocomplete="off">
                            <span class="input-group-btn">
                                <button class="btn btn-success font-bold" type="button" ng-click="startSearch($parent.like)">
                                    <span translate="business.navtitle.search_patient">Search</span></button>
                            </span>
                        </div>
                    </div>
                </div>
                <table ui-jq="dataTable" style="width:100%" ui-options="dtOptions" class="table table-striped m-b-none">
                    <thead>
                    <tr class="row">
                        <th translate="business.servreq.id"></th>
                        <th translate="common.updated" ng-if="!isSmart"></th>
                        <th translate="common.name"></th>
                        <th translate="user.gender" ng-if="!isSmart"></th>
                        <th translate="business.patcase.disease_type" ng-if="!isSmart"></th>
                        <th translate="common.evaluated"></th>
                        <th class="" translate="common.operate"></th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr class="row" ng-repeat="serv in servRequests">
                        <td>S-{{ serv.servReq_Id }}</td>
                        <td ng-if="!isSmart">{{ moment(serv._patCase._patient.updated).format('YYYY-MM-DD') }}</td>
                        <td>{{ serv._patCase._patient._user.realName }}</td>
                        <td ng-if="!isSmart">
                            <span ng-show="serv._patCase._patient._user.gender != null" translate="{{'user.gender.' + serv._patCase._patient._user.gender}}"></span>
                        </td>
                        <td ng-if="!isSmart">
                            <span translate="{{'business.patcase.disease_type_' + serv._diseaseType.desc}}"></span>
                        </td>
                        <td>
                            <span translate="{{(serv._customCareCase.isFinish)?'business.evaluation.evaluated':'business.evaluation.not_evaluated'}}"></span>
                        </td>
                        <td style=" width:20%;">
                            <script type="text/ng-template" id="openServReq.html">
                                <div ng-include="'views/work/basic_servreq_flow.html?abc=d'"></div>
                            </script>
                            <button type="button"
                                    ng-click="open({ templateUrl: 'openServReq.html'}, {{ serv }} );"
                                    class="btn btn-sm btn-info font-bold">
                                <span translate="{{'common.details'}}"></span>
                            </button>
                            <button type="button"
                                    ng-click="startEditEvaluation(serv.servReq_Id)"
                                    class="btn btn-sm btn-warning font-bold">
                                <span translate="{{'user.evaluation'}}"></span>
                            </button>
                            <button type="button"
                                    ng-click="openComplete(serv)"
                                    class="btn btn-sm btn-success font-bold"">
                                <span translate="{{'business.servreq.finish'}}"></span>
                            </button>
                        </td>
                    </tr>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>

<script type="text/ng-template" id="openComplete.html">
    <div class="modal-content">
        <div class="modal-header">
            <button type="button" class="close" ng-click="cancel()"><span class="icon icon-close"
                                                                          aria-hidden="true"></span></button>
            <h4 class="modal-title" id="myModalLabel"><span translate="business.servreq.finish"></span></h4>
        </div>
        <div class="modal-body">
            <div class="form-horizontal">
                <div class="form-group row">
                    <label class="col-sm-12 control-label text-left"><p class="text-muted"><span
                            translate="business.accumulation.openCompleteips"></span></p></label>
                </div>
                <div class="form-group row">
                    <label class="col-sm-2 control-label "><span translate="common.name"></span></label>

                    <div class="col-sm-4">
                        <input type="text" class="form-control" placeholder=""
                               value="{{items._patCase._patient._user.realName}}" disabled style="cursor:default">
                    </div>
                    <label class="col-sm-2 control-label "><span translate="user.gender"></span></label>

                    <div class="col-sm-4">
                        <input type="text" class="form-control" placeholder=""
                               value="{{'user.gender.' + items._patCase._patient._user.gender | translate}}" disabled
                               style="cursor:default">
                    </div>
                </div>
                <div class="form-group row">
                    <label class="col-sm-2 control-label "><span
                            translate="business.patcase.disease_type"></span></label>

                    <div class="col-sm-4">
                        <input type="text" class="form-control" placeholder=""
                               value="{{'business.patcase.disease_type_' + items._diseaseType.desc | translate}}"
                               disabled style="cursor:default">
                    </div>
                    <label class="col-sm-2 control-label" translate=""><span
                            translate="common.evaluated"></span></label>

                    <div class="col-sm-4">
                        <input type="text" class="form-control" placeholder=""
                               value="{{ (items._customCareCase.isFinish)?'business.evaluation.evaluated':'business.evaluation.not_evaluated' |translate }}"
                               disabled style="cursor:default">
                    </div>
                </div>
            </div>
        </div>
        <div class="modal-footer">
            <button type="button" class="btn btn-default" ng-click="cancel()"><span translate="common.close"></span>
            </button>
            <button type="button" class="btn btn-primary" ng-click="ok()" ng-if="items._customCareCase.isFinish"><span
                    translate="business.servreq.finish"></span></button>
        </div>
    </div>
</script>

